package com.jia.train.seat.request;

import com.fasterxml.jackson.annotation.JsonFormat;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;

import java.util.Date;
import java.util.List;

@Data
public class ConfirmOrderDoRequest {

    private Long id;

    @JsonFormat(pattern = "yyyy-MM-dd")
    @NotNull(message = "[日期] 不能为空")
    private Date date;

    @NotEmpty(message = "[车次编号] 不能为空")
    private String tripCode;

    @NotEmpty(message = "[始发站] 不能为空")
    private String start;

    @NotEmpty(message = "[终点站] 不能为空")
    private String end;

    @NotNull(message = "[余票id] 不能为空")
    private Long dailyTrainTicketId;

    private List<ConfirmOrderTicketRequest> tickets;

    @Override
    public String toString() {
        return new ToStringBuilder(this)
                .append("id", id)
                .append("date", date)
                .append("tripCode", tripCode)
                .append("start", start)
                .append("end", end)
                .append("dailyTrainTicketId", dailyTrainTicketId)
                .append("tickets", tickets)
                .toString();
    }
}
